﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MP3Ganizer.Common.Interfaces.DirectoryLoader;
using System.Windows.Controls;
using Microsoft.Practices.ServiceLocation;
using Microsoft.Practices.Unity;
using CP.Windows.Forms;
using System.Windows;

namespace MP3Ganizer.Modules.DirectoryLoader.Views
{
    class DirectoryLoaderView : ContentControl, IDirectoryLoaderView
    {
        #region Fields
        private readonly IUnityContainer _container;
        private ShellFolderBrowser _folderBrowserSource;
        private ShellFolderBrowser _folderBrowserDestination;
        private IDirectoryLoaderViewModel _model;
        #endregion

        public DirectoryLoaderView()
        {
            DataContext = ServiceLocator.Current.GetInstance<IDirectoryLoaderViewModel>();
            _folderBrowserSource = new ShellFolderBrowser();
            _folderBrowserSource.Initialized += new EventHandler(_folderBrowserSource_Initialized);
            _folderBrowserDestination = new ShellFolderBrowser();
            _folderBrowserDestination.Initialized += new EventHandler(_folderBrowserDestination_Initialized);
        }



        private void SourceDirButton_Click(object sender, RoutedEventArgs e)
        {
            _folderBrowserSource.Title = "Source";
            if (_folderBrowserSource.ShowDialog())
            {
                //SourceDirTextBox.Text = _folderBrowserSource.FolderPath;
            }
        }

        void _folderBrowserSource_Initialized(object sender, EventArgs e)
        {
            //_folderBrowserSource.SetSelection(SourceDirTextBox.Text);
        }


        private void DestinationDirButton_Click(object sender, RoutedEventArgs e)
        {
            _folderBrowserDestination.Title = "Destination";
            //if (_folderBrowserDestination.ShowDialog())
                //DestDirTextBox.Text = _folderBrowserDestination.FolderPath;
        }

        void _folderBrowserDestination_Initialized(object sender, EventArgs e)
        {
            //_folderBrowserDestination.SetSelection(DestDirTextBox.Text);
        }
    }


}
